package com.wzdigit.wms.wms.config.schedule;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Condition;
import org.springframework.context.annotation.ConditionContext;
import org.springframework.core.type.AnnotatedTypeMetadata;
import org.springframework.stereotype.Component;

/**
 * @ClassName ScheduleSwitch
 * @Description TODO
 * @Author LHR-PC
 * @Date 2021/3/18 16:36
 * @Version
 **/
@Component
public class ScheduleSwitch implements Condition {

    @Value("${schedule.common.switch}")
    private String taskSwitch;

    @Override
    public boolean matches(ConditionContext conditionContext, AnnotatedTypeMetadata annotatedTypeMetadata) {
        return Boolean.parseBoolean(taskSwitch);
    }
}
